
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import reverse
from jinja2 import Environment


def jinjia2_environment(**options):
    '''创建jinja2环境对象'''
    env = Environment(**options)
    env.globals.update({
        'status': staticfiles_storage.url,
        'url': reverse,
    })
    return env